package com.ncbee.base.web.base;

import com.ncbee.base.model.vo.UserInfo;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: fengzirong
 * @Description:
 * 主要功能系统首页
 * @Date:Create in 22:36 2018/9/11
 */
@Controller
@RequestMapping("/common")
public class CommonController{
    @RequestMapping("homePage")
    public String homePage(){
        return "common/homePage";
    }
    @RequestMapping("index")
    public String index(HttpServletRequest request){
        Subject subject=SecurityUtils.getSubject();//获取当前登录用户信息
        UserInfo userInfo=(UserInfo)subject.getPrincipal();//用户信息
        request.setAttribute("loginUser",userInfo);
        return "leftNavIndex";
    }
    @RequestMapping("login")
    public String login(){
        return "login";
    }

}
